package cn.wu.reggie.service.impl;

import cn.wu.reggie.entity.City;
import cn.wu.reggie.entity.Province;
import cn.wu.reggie.mapper.CityMapper;
import cn.wu.reggie.mapper.ProvinceMapper;
import cn.wu.reggie.service.AddrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddrServiceImpl implements AddrService {

    @Autowired
    ProvinceMapper provinceMapper;

    @Autowired
    CityMapper cityMapper;

    @Override
    public List<Province> findAllProvinces() {
        return provinceMapper.findAll();
    }

    @Override
    public List<City> findCitiesByPid(Integer pid) {
        return cityMapper.findCitiesByPid(pid);
    }
}